package com.example.stockservice.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class StockController {

    @GetMapping("/stock/reduce")
    public String reduceStock(@RequestParam("productId") String productId,
                              @RequestParam("stockNum") int stockNum) {
        log.info("扣减库存, 商品ID: {}, 数量: {}", productId, stockNum);
        return "库存扣减成功!";
    }
}
